home *** CD-ROM | disk | FTP | other *** search
- ////////////////////////////////////////////////////////////////////////////////////////////
- //
- // PRODUCT: Norton Internet Security/Symantec Desktop Firewall
- //
- // NAME: wiz-DefaultAccount.js (Javascript file for wiz-DefaultAccount.HTM)
- //
- // Copyright (c) by Symantec Corporation. All rights reserved.
- //
- ////////////////////////////////////////////////////////////////////////////////////////////
-
-
- function Page_GoNext()
- {
- return true;
- }
-
- function Page_GoBack()
- {
- return true;
- }
-
- var g_szSelectedUser = "";
- var szNotLoggedOn = StrID("ParentalProductivity_NotLoggedOn");
-
- function page_OnLoad()
- {
- // Disable NextButton so user cannot constantly click next.
- window.parent.frames("bottom").NextB.disabled = true;
-
- window.NISTitleName1.innerText = WrapNisum.ProductName;
-
- // Set NIS Pro Specific Text
- var sProductType = WrapNisum.ProductType ;
-
- if(sProductType == "PT_PRO")
- {
- window.ParentalProductivityRestricted.innerText = StrID("ParentalProductivityRestricted_NISPRO_Caps");
- }
-
- DefUserList.SetColumnCount(1);
- DefUserList.SetColumnWidth(0, "95%");
- DefUserList.OnClick = UserList_OnClick;
-
- // Load the user list
- DSO.XMLDocument.loadXML(parent.UserManager.UserNames.xml);
-
- // Add all the items to the list control
- var nItr = 0;
- var pRow = null;
- var pChildNodeList = DSO.XMLDocument.selectNodes("/Users/User");
- var pNone = null;
- var szUserName = "";
- var szDefaultUser = parent.UserManager.DefaultUser;
- var pRowToSel = null;
-
- for(nItr = 0; nItr < pChildNodeList.length; nItr++)
- {
- pNode = pChildNodeList.item(nItr);
- szUserName = pNode.attributes.getNamedItem("name").nodeValue;
- if(!szUserName || szUserName == "")
- szUserName = szNotLoggedOn;
-
- pRow = DefUserList.InsertRow(-1);
- DefUserList.SetCellTextPtr(pRow, 0, szUserName);
-
- if(szDefaultUser == szUserName || (szDefaultUser == "" && szUserName == szNotLoggedOn))
- {
- pRowToSel = pRow;
- g_szSelectedUser = szUserName;
- }
- }
-
- if(pRowToSel)
- DefUserList.LCInternal_SetSelPtr(pRowToSel);
- else
- g_szSelectedUser = "";
-
- // Enable next button
- window.parent.frames("bottom").NextB.disabled = false;
- }
-
- function UserList_OnClick(nRow)
- {
- g_szSelectedUser = DefUserList.GetCellText(nRow, 0);
-
- // Set the current user
- if(g_szSelectedUser == szNotLoggedOn)
- parent.UserManager.DefaultUser = "";
- else
- parent.UserManager.DefaultUser = g_szSelectedUser;
- }
-
- function NextClicked()
- {
- if(!g_szSelectedUser || g_szSelectedUser == "")
- {
- parent.newAlert(StrID("ParentalProductivity_NoUserSelected"), parent.UserManager.AppTitle, 3, 0, 0, 0);
- window.parent.frames("bottom").NextB.disabled = false;
- return false;
- }
-
- return true;
- }
-
- function page_OnUnload()
- {
- // Disable NextButton so user cannot constantly click next.
- window.parent.frames("bottom").NextB.disabled = true;
-
- // If the page is unloaded without a selection select the second item in the list
- if(!g_szSelectedUser || g_szSelectedUser == "")
- {
- var szUser = DefUserList.GetCellText(1, 0);
- parent.UserManager.DefaultUser = szUser;
- }
-
- // Enable Next Button.
- window.parent.frames("bottom").NextB.disabled = false;
- }
-
- function OnKeyDownHandler()
- {
- // Last Control Tab over to the <back, next, close> button.
- var VK_ESCAPE = 27;
-
- if (window.event.keyCode == VK_ESCAPE)
- {
- // Escape key.. We want to exit out of the wizard..
- parent.window.navigate("res://closeme.xyz");
-
- }
-
- }
-